<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .float,.flex,.position {
        width: 100%;
        height: 100px;
    }
    .float .left {
        width: 100px;
        height: 100%;
        background-color: deepskyblue;
        float: left;
    }
    .float .mid {
        height: 100%;
        margin-left: 100px;
        margin-right: 100px;
        background-color: saddlebrown;
    }
    .float .right {
        width: 100px;
        height: 100%;
        background-color: #bbffaa;
        float: right;
    }
    .flex {
        display: flex;
        justify-content: space-evenly;
        align-items: center;
    }
    .flex .left {
        width: 100px;
        height: 100%;
        background-color: #7c83fd;
    }
    .flex .mid {
        flex: 1;
        height: 100%;
        background-color: red;
    }
    .flex .right {
        width: 100px;
        height: 100%;
        background-color: rosybrown;
    }
    .position {
        position: relative;
        /*overflow: hidden;*/
    }
    .position .left {
        position: absolute;
        left: 0;
        width: 100px;
        height: 100%;
        background-color: sandybrown;
    }
    .position .mid {
        /*position方式1 会产生覆盖*/
        /*position: absolute;*/
        /*background-color: fuchsia;*/
        /*height: 100%;*/
        /*width: 100%;*/
        /*left: 100px;*/
        /*position方式2 最上面指定了宽度100% 不会产生覆盖*/
        margin-left: 100px;
        margin-right: 100px;
        background-color: fuchsia;
        height: 100%;
    }

    .position .right {
        position: absolute;
        top: 0;
        right: 0;
        width: 100px;
        height: 100%;
        background-color: maroon;
    }
</style>
<body>
float
<div class="float">
    <div class="left"></div>
    <div class="right"></div>
<!--    最后一栏在最后-->
    <div class="mid"></div>
</div>
flex
<div class="flex">
    <div class="left"></div>
    <div class="mid"></div>
    <div class="right"></div>
</div>
position
<div class="position">
    <div class="left"></div>
    <div class="mid"></div>
    <div class="right"></div>
</div>
</body>
</html>
